# This dockerfile is specific to building Multus for OpenShift
FROM openshift/golang-builder@sha256:4820580c3368f320581eb9e32cf97aeec179a86c5749753a14ed76410a293d83 AS rhel8
ENV __doozer=update BUILD_RELEASE=202202160023.p0.g55e1cf1.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202202160023.p0.g55e1cf1.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=55e1cf1 OS_GIT_VERSION=4.10.0-202202160023.p0.g55e1cf1.assembly.stream-55e1cf1 SOURCE_DATE_EPOCH=1644241765 SOURCE_GIT_COMMIT=55e1cf1c72a5cd4b7bfa273bcd809f3282e317de SOURCE_GIT_TAG=55e1cf1 SOURCE_GIT_URL=https://github.com/openshift/containernetworking-plugins 
ADD . /usr/src/plugins
WORKDIR /usr/src/plugins
ENV CGO_ENABLED=0
RUN ./build_linux.sh && \
    cd /usr/src/plugins/bin
WORKDIR /

FROM openshift/golang-builder@sha256:4820580c3368f320581eb9e32cf97aeec179a86c5749753a14ed76410a293d83 AS rhel7
ENV __doozer=update BUILD_RELEASE=202202160023.p0.g55e1cf1.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202202160023.p0.g55e1cf1.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=55e1cf1 OS_GIT_VERSION=4.10.0-202202160023.p0.g55e1cf1.assembly.stream-55e1cf1 SOURCE_DATE_EPOCH=1644241765 SOURCE_GIT_COMMIT=55e1cf1c72a5cd4b7bfa273bcd809f3282e317de SOURCE_GIT_TAG=55e1cf1 SOURCE_GIT_URL=https://github.com/openshift/containernetworking-plugins 
ADD . /usr/src/plugins
WORKDIR /usr/src/plugins
ENV CGO_ENABLED=0
RUN ./build_linux.sh && \
    cd /usr/src/plugins/bin
WORKDIR /

FROM openshift/golang-builder@sha256:4820580c3368f320581eb9e32cf97aeec179a86c5749753a14ed76410a293d83 AS windows
ENV __doozer=update BUILD_RELEASE=202202160023.p0.g55e1cf1.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202202160023.p0.g55e1cf1.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=55e1cf1 OS_GIT_VERSION=4.10.0-202202160023.p0.g55e1cf1.assembly.stream-55e1cf1 SOURCE_DATE_EPOCH=1644241765 SOURCE_GIT_COMMIT=55e1cf1c72a5cd4b7bfa273bcd809f3282e317de SOURCE_GIT_TAG=55e1cf1 SOURCE_GIT_URL=https://github.com/openshift/containernetworking-plugins 
ADD . /usr/src/plugins
WORKDIR /usr/src/plugins
ENV CGO_ENABLED=0
RUN yum install -y dos2unix
RUN ./build_windows.sh && \
    cd /usr/src/plugins/bin
WORKDIR /

FROM openshift/ose-base:v4.10.0.20220216.010142
ENV __doozer=update BUILD_RELEASE=202202160023.p0.g55e1cf1.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202202160023.p0.g55e1cf1.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=55e1cf1 OS_GIT_VERSION=4.10.0-202202160023.p0.g55e1cf1.assembly.stream-55e1cf1 SOURCE_DATE_EPOCH=1644241765 SOURCE_GIT_COMMIT=55e1cf1c72a5cd4b7bfa273bcd809f3282e317de SOURCE_GIT_TAG=55e1cf1 SOURCE_GIT_URL=https://github.com/openshift/containernetworking-plugins 
RUN mkdir -p /usr/src/plugins/bin && \
    mkdir -p /usr/src/plugins/rhel7/bin && \
    mkdir -p /usr/src/plugins/rhel8/bin && \
    mkdir -p /usr/src/plugins/windows/bin
COPY --from=rhel7 /usr/src/plugins/bin/* /usr/src/plugins/rhel7/bin/
COPY --from=rhel8 /usr/src/plugins/bin/* /usr/src/plugins/bin/
COPY --from=rhel8 /usr/src/plugins/bin/* /usr/src/plugins/rhel8/bin/
COPY --from=windows /usr/src/plugins/bin/* /usr/src/plugins/windows/bin/

LABEL \
        io.k8s.display-name="Container Networking Plugins" \
        io.k8s.description="This is a component of OpenShift Container Platform and provides the reference CNI plugins." \
        io.openshift.tags="openshift" \
        maintainer="Doug Smith <dosmith@redhat.com>" \
        name="openshift/ose-container-networking-plugins" \
        com.redhat.component="ose-containernetworking-plugins-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Networking" \
        io.openshift.maintainer.subcomponent="multus" \
        release="202202160023.p0.g55e1cf1.assembly.stream" \
        io.openshift.build.commit.id="55e1cf1c72a5cd4b7bfa273bcd809f3282e317de" \
        io.openshift.build.source-location="https://github.com/openshift/containernetworking-plugins" \
        io.openshift.build.commit.url="https://github.com/openshift/containernetworking-plugins/commit/55e1cf1c72a5cd4b7bfa273bcd809f3282e317de" \
        version="v4.10.0"

